﻿using AdventureWorks.Application.Views.Production;
using AppExtensions.Presenters;
using System.Configuration;
using System.Linq;
using AdventureWorks.Application.Controllers;

namespace AdventureWorks.Application.Presenters.Production {
  public class DefaultPresenter : BasePresenter<IDefaultView> {
    public override void OnViewFirstLoaded() {
      var db = new AdventureWorks.LinqDataSource.AdventureWorks(AppController.AdventureWorksConnectionString);
      var products = db.FetchAllProducts(20);
      var topProducts = db.FetchTopProducts(10);
      View.Products = products;
      View.TopProducts = topProducts;
    }
  }
}
